// import { useState } from 'react'
// import reactLogo from '../assets/react.svg'
// import viteLogo from '/vite.svg'
import './App.css'
import {Route, Routes} from "react-router-dom";
import Login from "./login";
import ProtectedRoute from "../components/ProtectedRoute.tsx";
import Namespace from "./namespace";
import HomePage from "./home";
import Page404 from "./_404";
import Games from "./games";
import Channels from "./channels";
import Products from "./products";
import Users from "./users";
import Orders from "./orders";
import Data from "./data";
import Dashboard from "./dashboard";

function App() {

    return (
        <Routes>
            <Route path="/" element={<Login/>}></Route>
            <Route path="/login" element={<Login/>}></Route>
            <Route path={'/*'} element={<ProtectedRoute children={
                <Routes>
                    <Route path="/namespace" element={<Namespace/>}></Route>
                    <Route path="/home" element={<HomePage/>}></Route>
                    <Route path="/games" element={<Games/>}></Route>
                    <Route path="/channels" element={<Channels/>}></Route>
                    <Route path="/products" element={<Products/>}></Route>
                    <Route path="/users" element={<Users/>}></Route>
                    <Route path="/orders" element={<Orders/>}></Route>
                    <Route path="/data" element={<Data/>}></Route>
                    <Route path="/dashboard" element={<Dashboard/>}></Route>
                    <Route path="/*" element={<Page404/>}></Route>
                </Routes>
            }/>}>
            </Route>
        </Routes>
    )


    // const [count, setCount] = useState(0)
    //
    // return (
    //   <>
    //     <div>
    //       <a href="https://vite.dev" target="_blank">
    //         <img src={viteLogo} className="logo" alt="Vite logo" />
    //       </a>
    //       <a href="https://react.dev" target="_blank">
    //         <img src={reactLogo} className="logo react" alt="React logo" />
    //       </a>
    //     </div>
    //     <h1>Vite + React</h1>
    //     <div className="card">
    //       <button onClick={() => setCount((count) => count + 1)}>
    //         count is {count}
    //       </button>
    //       <p>
    //         Edit <code>src/App.tsx</code> and save to test HMR
    //       </p>
    //     </div>
    //     <p className="read-the-docs">
    //       Click on the Vite and React logos to learn more
    //     </p>
    //   </>
    // )
}

export default App
